import apis from './'
import request from '@/utils/request'

export function getMessageList (parameter) {
  return request({
    url: apis.MessageList,
    method: 'get',
    params: parameter
  })
}

export function getAddMsg () {
  return request({
    url: apis.SendMsg,
    method: 'get'
  })
}

export function postAddMsg (data) {
  return request({
    url: apis.SendMsg,
    method: 'post',
    data: data
  })
}

export function getEditMsg (id) {
  return request({
    url: `${apis.EditMsg}?msg_id=${id}`,
    method: 'get'
  })
}

export function postEditMsg (data) {
  return request({
    url: `${apis.EditMsg}?msg_id=${data.id}`,
    method: 'post',
    data: data
  })
}
